-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(Tooltip): add a11y docs #2892
Conversation
PF4 preview: https://patternfly-org-pr-2892-v4.surge.sh/v4 |
bc24768
to
123a574
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks for working on this! 🙂
@nicolethoen from the backlog meeting earlier, I noticed one issue regarding Popover and adding hover functionality. After digging through that, based on issue #2871 + conversation in the issue linked in it, do you think it would be better to update the a11y docs for Tooltips taking into account these intended changes to Tooltip + Popover? For the most part may just be a case of re-adding the recommendation to not use tooltips on static elements, and then later adding in any other verbiage the design guidelines end up including. |
I think I agree - we should include the recommendation of not using tooltips on static elements and then we can follow up if recommendations evolve. |
56ce05e
123a574
to
56ce05e
Compare
Updated the docs a bit based on convo above. I also included some verbiage for when one might use |
@thatblindgeye I think the information here is very helpful - but it is a lot of information. I wonder if each or most of your bullet points could benefit from a snippet of html or react to demonstrate what you are describing. Sort of link how we do on the website when talking about icons accessibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really love these updates! I think it's a good call out that you're differentiating labeling from supplementary information.
I think Nicole makes a good suggestion as well. Adding small snippets/examples helps make the points clearer and more consumable.
56ce05e
to
a102072
Compare
@nicolethoen @jessiehuff I updated the tooltip doc with the new template. I also added in some code blocks/examples for certain things throughout. For examples with specific props, they're not exactly inline in the table and instead placed in sub-sections, so let me know what you think of that sort of layout or if you have other ideas for how to go about them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the new template for this, but I find the top section a little confusing between the React and HTML/CSS bullet points. At first I thought that you meant that everyone needs to add all of those things. For example, I saw the point about adding the role and thought, "isn't that already added for you?" Then I realized that you meant if you're just using the HTML/CSS, not that you need to add HTML/CSS. Admittedly I think previously I just included the React suggestions before and kept the HTML/CSS in the customization section. However, I can understand why it might make sense to keep at the top, but I'd be curious what others think. Do you think it would be helpful for us to separate that into two different categories at the top to keep it clear? Or maybe it was just me that got confused haha.
I definitely think you raise a valid point. What do you think of something along the lines of this instead:
The "if using X library..." could also be placed first, e.g. "If using the HTML/CSS library, pass in If we did want separate bulleted lists, we could do something along the lines of:
|
I think I like your second suggestion more. maybe something like: To implement an accessible PatternFly tooltip:
Using react:
Using HTML/CSS:
|
a102072
to
f0eb69d
Compare
f0eb69d
to
5ac2896
Compare
…nto text-input-group * 'main' of https://github.com/patternfly/patternfly-org: (170 commits) chore(release): releasing packages [ci skip] Updates button info architecture to align with guidelines. (patternfly#3061) Card design guideline changes. (patternfly#3087) chore(release): releasing packages [ci skip] iss3078 (patternfly#3079) chore(release): releasing packages [ci skip] changing alert guidelines (patternfly#3064) chore(release): releasing packages [ci skip] mastshead (patternfly#3062) chore(release): releasing packages [ci skip] jumplink (patternfly#3051) chore(release): releasing packages [ci skip] calendar (patternfly#3058) chore(release): releasing packages [ci skip] feat(doc-framework): add dark theme toggle for full page examples (patternfly#3056) chore(release): releasing packages [ci skip] edit overflow guidelines (patternfly#3038) chore(release): releasing packages [ci skip] docs(a11y): create template for a11y docs (patternfly#3019) docs(Tooltip): add a11y docs (patternfly#2892) ... # Conflicts: # packages/v4/patternfly-docs/content/design-guidelines/components/text-input-group/img/attribute-value-filter.png # packages/v4/patternfly-docs/content/design-guidelines/components/text-input-group/img/auto-complete-search.png # packages/v4/patternfly-docs/content/design-guidelines/components/text-input-group/img/text-input-elements.png # packages/v4/patternfly-docs/content/design-guidelines/components/text-input-group/text-input-group.md
* docs(Tooltip): add a11y docs * Update documentation * Align verbiage with intended design * Convert doc to align with new guidelines * Update docs to new template * Separate instructions for libraries * Update a11y section in design guidelines
Closes #2596
Tooltip a11y tab
Current implementation for a11y docs on the tooltip. This is based off of the current changes made in patternfly/patternfly-react#7332 and patternfly/patternfly-react#7335.
Additionally, I added in some verbiage in regards to tooltips on static elements. In #1108 (comment) it was mentioned that tooltips on static elements shouldn't be recommended. However, utilizing the pattern of
aria-live
instead ofaria-describedby
does seem to resolve the gaps mentioned.Original comment:
One proposal I want to put out there is whether we should include verbiage for when a tooltip shouldn't be announced to screen reader users. Specifically, if an element already has a label (such as via
aria-label
), and the tooltip contents is essentially the same thing, should the tooltip then be prevented from being announced to screen reader users to avoid redundant/duplicate announcements? Or would the better approach be to avoid adding anaria-label
if a tooltip is to be attached (as we've seen with using React refs, tooltips may not always be announced, though I've noticed a possible fix could be usingaria-live
on tooltips attached via ref)?Using the Tooltip on icon example, if the example code was changed so that the button had
aria-label="Copy contents to clipboard"
, a screen reader could announce both that and the tooltip contents, which would be redundant information. This could also be trying to solve a problem that may not really exist or not be a significant issue, though.